package com.example.customviewpractice;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.customviewpractice.combination.TitleBarActivity;
import com.example.customviewpractice.counter.CounterActivity;
import com.example.customviewpractice.expand.CustomListViewActivity;

public class MainActivity extends AppCompatActivity {

    private Button titleBarBtn;

    private Button counterViewBtn;

    private Button customListView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button titleBarBtn = findViewById(R.id.title_bar_btn);
        titleBarBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, TitleBarActivity.class);
                startActivity(intent);
            }
        });

        Button counterViewBtn = findViewById(R.id.counter_view_btn);
        counterViewBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, CounterActivity.class);
                startActivity(intent);
            }
        });


        Button customListView = findViewById(R.id.custom_list_view);
        customListView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, CustomListViewActivity.class);
                startActivity(intent);
            }
        });
    }


}
